import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'

import './assets/css/global.css'
import './assets/font/iconfont.css'

import Axios from 'axios'
// 请求根路径
Axios.defaults.baseURL = 'http://119.23.53.78:8888/api/private/v1'
// Axios.defaults.baseURL = 'http://localhost:8081/api/private/v1' 本地路径
Axios.interceptors.request.use(config => {
  console.log(config)
  // 添加token字段到session中
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
// 方便Axios调用
Vue.prototype.$http = Axios

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
